<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>客服管理后台</title>
    <link rel="stylesheet" href="admin-chat.css">
</head>
<body>
    <div class="admin-container">
        <header class="admin-header">
            <div class="header-left">
                <button id="backBtn" class="back-btn" onclick="window.location.href='http://localhost:5173/myShop/info'">
                    <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
                        <path d="M19 12H5M12 19l-7-7 7-7"/>
                    </svg>
                    返回
                </button>
                <h1>客服管理后台</h1>
            </div>
            <div class="admin-info">
                <span class="admin-name">客服管理员</span>
                <div class="status-indicator">
                    <span class="status-dot"></span>
                    <span class="status-text">在线</span>
                </div>
            </div>
        </header>

        <div class="main-content">
            <aside class="user-list">
                <h3>在线用户</h3>
                <div class="user-count">
                    <span id="onlineCount">0</span> 位用户在线
                </div>
                <div id="userList" class="user-items">
                    <!-- 用户列表将动态生成 -->
                </div>
            </aside>

            <main class="chat-area">
                <div class="chat-header">
                    <h3 id="currentUserName">选择一个用户开始对话</h3>
                    <div class="chat-actions">
                        <button id="clearChatBtn" class="btn-secondary" disabled>清空对话</button>
                        <button id="endChatBtn" class="btn-danger" disabled>结束对话</button>
                    </div>
                </div>

                <div class="chat-messages" id="chatMessages">
                    <div class="welcome-message">
                        <p>欢迎使用客服管理系统</p>
                        <p>请从左侧选择一个用户开始对话</p>
                    </div>
                </div>

                <div class="chat-input-container">
                    <div class="quick-replies">
                        <button class="quick-reply-btn" data-message="您好，我是客服，有什么可以帮助您的吗？">欢迎语</button>
                        <button class="quick-reply-btn" data-message="请稍等，我正在为您查询相关信息。">请稍等</button>
                        <button class="quick-reply-btn" data-message="感谢您的耐心等待，请问还有其他问题吗？">感谢等待</button>
                        <button class="quick-reply-btn" data-message="感谢您的咨询，祝您生活愉快！">结束语</button>
                    </div>
                    <div class="input-group">
                        <textarea id="messageInput" placeholder="输入回复内容..." maxlength="500" rows="3"></textarea>
                        <button id="sendButton" class="send-btn" disabled>
                            <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
                                <path d="M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z"/>
                            </svg>
                            发送
                        </button>
                    </div>
                    <div class="input-hint">
                        <span id="charCount">0</span>/500
                    </div>
                </div>
            </main>
        </div>
    </div>

    <div class="connection-status" id="connectionStatus">
        <span class="status-text">正在连接...</span>
    </div>

    <script src="admin-chat.js"></script>
</body>
</html>